import request from '@/config/axios'

// 协议标准 VO
export interface ProtocolStandardVO {
  id: number // 主键
  deviceType: string // 仪器类型
  serialNumber: string // 序号
  protocolCode: string // 协议代码
  protocolName: string // 协议名称
  state: boolean // 状态
  remark: string // 备注
}

// 协议标准 API
export const ProtocolStandardApi = {
  // 查询协议标准分页
  getProtocolStandardPage: async (params: any) => {
    return await request.get({ url: `/base/protocol-standard/page`, params })
  },

  // 查询协议标准详情
  getProtocolStandard: async (id: number) => {
    return await request.get({ url: `/base/protocol-standard/get?id=` + id })
  },

  // 新增协议标准
  createProtocolStandard: async (data: ProtocolStandardVO) => {
    return await request.post({ url: `/base/protocol-standard/create`, data })
  },

  // 修改协议标准
  updateProtocolStandard: async (data: ProtocolStandardVO) => {
    return await request.put({ url: `/base/protocol-standard/update`, data })
  },

  // 启用仪器设备
  enable: async (id: number) => {
    return await request.get({ url: `/base/protocol-standard/enable?id=` + id })
  },

  // 禁用仪器设备
  disable: async (id: number) => {
    return await request.get({ url: `/base/protocol-standard/disable?id=` + id })
  },

  // 删除协议标准
  deleteProtocolStandard: async (id: number) => {
    return await request.delete({ url: `/base/protocol-standard/delete?id=` + id })
  },

  // 导出协议标准 Excel
  exportProtocolStandard: async (params) => {
    return await request.download({ url: `/base/protocol-standard/export-excel`, params })
  },
}
